package top.codedance.iotp.loadblance.algorithm;

import top.codedance.iotp.loadblance.entiy.RegistyUri;

import java.util.List;

public class Cycle extends Adapter {
    @Override
    public String execute(List<RegistyUri> registyUris, Func<String> func) {
        String serverUrl = null;
        for(RegistyUri registyUri : registyUris){
            serverUrl = func.run(registyUri.getUrl());
            if(serverUrl != null){
                break;
            }
        }
        return serverUrl;
    }
}
